Skip to content

refactor(table2): move striping logic to client-side JavaScript#7209

Open
Eetwalt wants to merge 11 commits intomainfrom
table2-striping-fix
Open

refactor(table2): move striping logic to client-side JavaScript#7209
Eetwalt wants to merge 11 commits intomainfrom
table2-striping-fix

Conversation

@Eetwalt
Copy link
Collaborator

@Eetwalt Eetwalt commented Mar 5, 2026

Summary

Move table2 row striping from Lua server-side rendering to client-side JavaScript to better handle rowspan grouping. Striping now treats rows with rowspan > 1 as a single visual group, automatically re-stripes when tables are sorted, and adds group hover highlighting for rowspan groups.

How did you test this change?

dev + devtools

Copilot AI review requested due to automatic review settings March 5, 2026 08:31
@Eetwalt Eetwalt requested review from a team as code owners March 5, 2026 08:31
@Eetwalt Eetwalt added stylesheets Changes to stylesheets javascript Changes to JavaScript files labels Mar 5, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Moves Table2 row striping from Lua-render-time logic to a client-side JS module, enabling rowspan-aware “group” striping, re-striping after sort operations, and hover highlighting across rowspan groups.

Changes:

  • Removed Lua BodyStripe context and server-side striping computation; Table2 rows now emit data-rowspan-count for client use.
  • Updated Table2 widget to expose data-striped="false" when striping is disabled, and removed standalone CSS nth-child striping.
  • Added javascript/commons/Table2.js to apply striping + group hover behavior and hooked it into javascript/Main.js.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
stylesheets/commons/Table2.scss Adds table2__row--group-hover styling; removes standalone nth-child striping rule.
lua/wikis/commons/Widget/Table2/TableBody.lua Removes server-side striping logic and BodyStripe context usage.
lua/wikis/commons/Widget/Table2/Table.lua Adds data-striped="false" when striped is disabled; no longer wraps body in stripe context.
lua/wikis/commons/Widget/Table2/Row.lua Emits data-rowspan-count for body rows to support JS grouping.
lua/wikis/commons/Widget/Contexts/Table2.lua Removes BodyStripe context.
javascript/commons/Table2.js New module implementing rowspan-aware striping, sortEnd re-striping, and group hover highlighting.
javascript/Main.js Includes Table2 module in the test loader list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Changes to JavaScript files stylesheets Changes to stylesheets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants